package org.springframework.samples.mvc.basic.controller;

import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;

public class JsonConverter {
	
	private static final ObjectMapper mapper = new ObjectMapper();
	
	public static final String convertToString(Object object) {
		try {
			return mapper.writeValueAsString(object);
		} catch (IOException e) {
			throw new RuntimeException("Error while parsing the object", e);
		}
	}

}
